package com.yadang.infra.controller;

import com.yadang.infra.base.ApiResult;
import com.yadang.infra.bean.CmmDictType;
import com.yadang.infra.bean.dto.CmmDictDto;
import com.yadang.infra.service.CmmDictDetailService;
import com.yadang.infra.service.CmmDictService;
import com.yadang.infra.service.CmmDictTypeService;
import com.yadang.infra.service.XmlFieldValidateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.invoke.MethodHandles;
import java.util.List;

@Api(tags = "XML字段校验接口")
@RestController
@RequestMapping("/infra/xmlfieldvalidate")
public class XmlFieldValidateController {
    private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

    @Autowired
    private XmlFieldValidateService xmlFieldValidateService;

    @PostMapping("validateField")
    public ApiResult<?> validateField(String xml){
        List<String> validate = xmlFieldValidateService.validate(xml);
        return ApiResult.success(validate);
    }

}
